import 'package:get/get.dart';
import 'package:mobile_vpn/pages/login_page/password_login_page/password_login_binding.dart';
import 'package:mobile_vpn/pages/member_page/member_extension_page/member_extension_binding.dart';
import 'package:mobile_vpn/pages/set_up/about_page.dart';
import 'package:mobile_vpn/pages/set_up/feedback_page/feedback_binding.dart';
import 'package:mobile_vpn/pages/set_up/feedback_page/feedback_page.dart';
import 'package:mobile_vpn/pages/set_up/message_center/message_binging.dart';
import 'package:mobile_vpn/pages/set_up/set_binging.dart';
import 'package:mobile_vpn/pages/set_up/version_page/version_binding.dart';
import 'package:mobile_vpn/pages/set_up/version_page/version_page.dart';
import 'package:mobile_vpn/pages/user_page/user_page.dart';
import '../pages/index/index_binding.dart';
import '../pages/index/index_page.dart';
import '../pages/login_page/forgot_password/forgot_password_binding.dart';
import '../pages/login_page/forgot_password/forgot_password_page.dart';
import '../pages/login_page/login_page.dart';
import '../pages/login_page/password_login_page/password_login_page.dart';
import '../pages/login_page/register_page/register_page.dart';
import '../pages/member_page/member_extension_page/member_extension_page.dart';
import '../pages/payment_page/payment_binding.dart';
import '../pages/payment_page/payment_page.dart';
import '../pages/set_up/accelerated_mode_page.dart';
import '../pages/set_up/color_page.dart';
import '../pages/set_up/contact_service.dart';

import '../pages/set_up/feedback_page/feedback_history/feedback_history_binding.dart';
import '../pages/set_up/feedback_page/feedback_history/feedback_history_page.dart';
import '../pages/set_up/message_center/message_logic.dart';
import '../pages/set_up/message_center/message_page.dart';
import '../pages/set_up/notifications_page.dart';
import '../pages/set_up/privacy_policy.dart';
import '../pages/set_up/service_agreement.dart';
import '../pages/set_up/set_page.dart';
import '../pages/set_up/version_page/history_page/history_binding.dart';
import '../pages/set_up/version_page/history_page/history_page.dart';
import '../pages/user_page/set_password/set_password_binging.dart';
import '../pages/user_page/set_password/set_password_page.dart';
import '../pages/user_page/user_bingding.dart';
import '../pages/user_page/user_set/user_set_bingding.dart';
import '../pages/user_page/user_set/user_set_page.dart';

class AppRoutes {
  static RxString curPage = indexPage.obs;
  static final prePage = Rxn<String>();

  static const indexPage = "/";
  static const aboutPage = "/about";
  static const contactServerPage = "/contact";
  static const privacyPolicyPage = "/privacy";
  static const serviceAgreementPage = "/agreement";
  static const setPage = "/set";
  static const colorPage = "/color";
  static const acceleratedModePage = "/acceleratedMode";
  static const notificationSettingPage = "/notification";
  static const payMentPage = "/payMent";
  static const messageCenterPage = "/messageCenter";
  static const userPage="/user";
  static const userSetPage="/userSet";
  static const setPasswordPage="/setPassword";
  static const feedbackPage="/feedback";
  static const feedbackHistoryPage="/feedbackHistory";
  static const versionPage="/version";
  static const historyPage="/history";
  static const memberExtensionPage="/memberExtension";
  static const loginPage="/login";
  static const passwordLoginPage="/passwordLogin";
  static const registerPage="/register";
  static const forgotPasswordPage="/forgotPassword";
  static final routerPages = [
    ///主入口
    GetPage(name: indexPage, page: () => IndexPage(), binding: IndexBinding()),
    GetPage(name: aboutPage, page: () => AboutPage(), binding: SetBinging()),
    GetPage(name: forgotPasswordPage, page: () => ForgotPasswordPage(), binding: ForgotPasswordBinding()),
    GetPage(name: feedbackHistoryPage, page: () => FeedbackHistoryPage(), binding: FeedbackHistoryBinding()),
    GetPage(name: feedbackPage, page: () => FeedbackPage(), binding: FeedbackBinding()),
    GetPage(name: messageCenterPage, page: () => MessageCenterPage(), binding: MessageBinging()),
    GetPage(name: payMentPage, page: () => PaymentPage(), binding: PaymentBinging()),
    GetPage(name: versionPage, page: () => VersionPage(), binding:VersionBinding()),
    GetPage(name: historyPage, page: () => HistoryPage(), binding:HistoryBinding()),
    GetPage(name: memberExtensionPage, page: () => MemberExtensionPage(), binding:MemberExtensionBinding()),
    GetPage(name: setPasswordPage, page: () => SetPasswordPage(), binding: SetPasswordBinging()),
    GetPage(name: setPage, page: () => SetPage(), binding: SetBinging()),
    GetPage(name: userPage, page: () => UserPage(), binding: UserBinging()),
    GetPage(name: userSetPage, page: () => UserSetPage(), binding: UserSetBinging()),
    GetPage(name: loginPage, page: () => LoginPage(), binding: IndexBinding()),
    GetPage(name: passwordLoginPage, page: () => PasswordLoginPage(), binding: PasswordLoginBinding()),
    GetPage(name: registerPage, page: () => RegisterPage()),
    GetPage(
        name: colorPage, page: () => ThemeColorPage(), binding: SetBinging()),
    GetPage(
        name: notificationSettingPage,
        page: () => NotificationSettingsPage(),
        binding: SetBinging()),
    GetPage(
        name: acceleratedModePage,
        page: () => AcceleratedModePage(),
        binding: SetBinging()),
    GetPage(
        name: serviceAgreementPage,
        page: () => ServiceAgreementPage(),
        binding: SetBinging()),
    GetPage(
        name: contactServerPage,
        page: () => ContactServicePage(),
        binding: SetBinging()),
    GetPage(
        name: privacyPolicyPage,
        page: () => PrivacyPolicyPage(),
        binding: SetBinging()),

    /// 发布页面
    // GetPage(
    //     name: publishPage,
    //     page: () => const PublishPage(),
    //     binding: PublishBinding(),
    //     transition: Transition.downToUp),

    /// 搜索页面
    // GetPage(
    //     name: searchPage,
    //     page: () => SearchPage(),
    //     binding: SearchBinding(),
    //     transition: Transition.fadeIn),

    /// 验证码登录页面
    // GetPage(
    //     name: verifyCodeLoginPage,
    //     page: () => const VerifyCodeLoginPage(),
    //     binding: VerifyCodeLoginBinding()),

    /// 用户中心页面--实用动态路由实现多实例
    // GetPage(
    //     name: userCenterPage,
    //     page: () => UserCenterPage(),
    //     binding: UserCenterBinding()),

    /// 用户编辑信息页面
    // GetPage(
    //     name: userEditCenterPage,
    //     page: () => const EditCenterPage(),
    //     binding: EditCenterBinding(),
    //     transition: Transition.fadeIn),

    /// 用户编辑昵称中心
    // GetPage(
    //     name: userEditNicknamePage,
    //     page: () => const EditNicknamePage(),
    //     binding: EditNicknameBinding()),

    /// 用户编辑签名中心
    // GetPage(
    //     name: userEditSignaturePage,
    //     page: () => const EditSignaturePage(),
    //     binding: EditSignatureBinding()),

    /// 裁剪头像
    // GetPage(
    //     name: userEditCropAvatarPage,
    //     page: () => const CropAvatarPage(),
    //     binding: CropAvatarBinding()),

    /// 粉丝--实用动态路由实现多实例
    // GetPage(
    //     name: fansPage,
    //     page: () => FansPage(),
    //     binding: FansBinding()),

    /// 乐豆
    // GetPage(
    //     name: experiencePage,
    //     page: () => ExperiencePage(),
    //     binding: ExperienceBinding()),

    /// 图片预览
    // GetPage(
    //     name: picPreviewPage,
    //     page: () => const PicPreviewPage(),
    //     binding: PicPreviewBinding(),
    //     transition: Transition.fadeIn),

    /// 设置页面
    // GetPage(
    //     name: settingPage,
    //     page: () => SettingPage(),
    //     binding: SettingBinding()),
  ];

  static Future<T?>? jumpPage<T>(String page,
      {dynamic arguments,
        int? id,
        bool preventDuplicates = true,
        Map<String, String>? parameters,
        bool needLogin = false,
        String? tag}) {
    return Get.toNamed(page,
        arguments: arguments,
        id: id,
        preventDuplicates: false,
        parameters: parameters);
  }
}
